﻿<phone:PhoneApplicationPage x:Class="TourThailand.LocationRecommendPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:Location="clr-namespace:System.Device.Location;assembly=System.Device"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            Orientation="Portrait"
                            SupportedOrientations="Portrait"
                            shell:SystemTray.IsVisible="True"
                            mc:Ignorable="d">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="WeatherCollectionItemTemplate">
            <StackPanel Margin="0,0,0,10" Background="{StaticResource PhoneAccentBrush}">
                <StackPanel Margin="10,10,0,0" Orientation="Horizontal">
                    <TextBlock Text="{Binding title}" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding dateTime}" />
                </StackPanel>
                <StackPanel Margin="10,10,0,10" Orientation="Horizontal">
                    <TextBlock FontSize="64" Text="{Binding low}" />
                    <TextBlock FontSize="64"
                               Text="/"
                               TextWrapping="Wrap" />
                    <TextBlock FontSize="64" Text="{Binding high}" />
                    <Image Width="100"
                           Height="100"
                           Margin="100,0,0,0"
                           Source="{Binding dayIcon}" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBarIconButton IconUri="appbar_button.png" Text="Ruote" Click="ApplicationBarIconButton_Click" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal" />
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal" />
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush" />
    </phone:PhoneApplicationPage.Foreground>
    <Grid x:Name="myGrid"
          Margin="7,0,-7,0"
          DataContext="{Binding Source={StaticResource TourThaiData}}">
        <Grid.Background>
            <ImageBrush ImageSource="Images/kohnghi2.jpg"
                        Opacity="0.5"
                        Stretch="UniformToFill" />
        </Grid.Background>
        <phone:Pivot Title="{Binding Title}">
            <phone:PivotItem Header="รายละเอียด">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.5*" />
                        <RowDefinition Height="0.5*" />
                    </Grid.RowDefinitions>
                    <Image Source="{Binding ImagePath}" Stretch="UniformToFill" />
                    <TextBlock Grid.Row="1"
                               HorizontalAlignment="Left"
                               VerticalAlignment="Top"
                               Text="{Binding Description}"
                               TextWrapping="Wrap" />
                </Grid>
            </phone:PivotItem>
            <phone:PivotItem Header="พยากรณ์อากาศ">
                <Grid>
                    <phone:LongListSelector x:Name="WeatherLongList"
                                            ItemTemplate="{StaticResource WeatherCollectionItemTemplate}"
                                            ItemsSource="{Binding WeatherCollection}"
                                            LayoutMode="List" />
                </Grid>
            </phone:PivotItem>
            <phone:PivotItem Header="แผนที่">
                <Grid>
                    <maps:Map x:Name="myMap">
                        <maps:Map.Center>
                            <Location:GeoCoordinate Altitude="NaN"
                                                    Course="NaN"
                                                    HorizontalAccuracy="NaN"
                                                    Latitude="10"
                                                    Longitude="101.2"
                                                    Speed="NaN"
                                                    VerticalAccuracy="NaN" />
                        </maps:Map.Center>
                    </maps:Map>
                </Grid>
            </phone:PivotItem>
        </phone:Pivot>
    </Grid>

    <!--  LayoutRoot is the root grid where all page content is placed  -->

</phone:PhoneApplicationPage>